package com.example.demo.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.entity.UserEntity;
import com.example.demo.mapper.UserMapper;
import com.example.demo.util.CIOUtil;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.UUID;


@Service
public class UserService {

    @Autowired
    UserMapper userMapper;

    public String registerUser(UserEntity userEntity) {
        userEntity.setId(UUID.randomUUID().toString());
        userMapper.insert(userEntity);

        return CIOUtil.buildRetMsg(true, "注册成功", null);
    }

    public UserEntity findByUsername(String userName){

        return userMapper.findUser(userName);

    }



}